﻿module Lhz.Page.DataView {
    class ServiceView extends ManagementPage<Lhz.Entity.ServiceCenter.Service> {
        constructor() {
            super({
                targetName: "服务",
                serviceNo: "service",
                editOperationName: "查看",
                queryOperationNo: "queryByUserGuid",
                colModel: [
                    {
                        title: "应用编号", dataIndx: "Application", width: "200", align: "center", render: function (event, ui) {
                            var item: Lhz.Entity.ServiceCenter.Service = event.rowData;
                            return item.Application.No;
                        }
                    },
                    {
                        title: "应用名称", dataIndx: "Application", width: "200", align: "center", render: function (event, ui) {
                            var item: Lhz.Entity.ServiceCenter.Service = event.rowData;
                            return item.Application.Name;
                        }
                    },
                    { title: "服务编号", dataIndx: "No", width: "200", align: "center" },
                    { title: "服务名称", dataIndx: "Name", width: "200", align: "center" },
                    { title: "Url", dataIndx: "Url", width: "300" },
                    { title: "描述", dataIndx: "Description", width: "300" }
                ],
                detailPageUrl: "service-view-detail.html",
                width: 1000,
                height: 600,
                getQueryArguments: function (mp) {
                    return [mp.user.Guid, ["Application"]];
                },
                getItemName: function (mp, item) {
                    return item.Name;
                }
            });
        }
    }
    $(function () {
        new ServiceView();
    });
}
